﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK;
using OpenTK.Input;

namespace opentk_first_project
{
    class Input
    {
        /// <summary>
        /// Get mouse position
        /// </summary>
        public Vector2 MousePosition 
        {
            get
            {
                return new Vector2(_mouseState.X, _mouseState.Y);
            }
        }
        MouseState _mouseState;
        KeyboardState _keyboardState;
        public float wheelDelta = 0;
        public float WheelDelta { get { return wheelDelta; } }
        public MouseState MouseState
        {
            get { return _mouseState; }
        }
        public KeyboardState KeyState
        {
            get { return _keyboardState; }
        }
        public Input()
        {
            
        }

        public void Update()
        {
            MouseState newMouseState = Mouse.GetState();
            wheelDelta = newMouseState.WheelPrecise - _mouseState.WheelPrecise;
            _mouseState = Mouse.GetState();
            _keyboardState = Keyboard.GetState();
            
            
        }

        public bool IsWheelUp()
        {
            return wheelDelta > 0;
        }

        public bool IsWheelDown()
        {
            return wheelDelta < 0;
        }

    }
}
